using System.Collections.Generic;

namespace ConsentManagementProviderLib.Enum
{
	internal static class CSharp2JavaStringEnumMapper
	{
		private static Dictionary<PRIVACY_MANAGER_TAB, string> privacyManagerTabToJavaEnumKey;

		private static Dictionary<CAMPAIGN_ENV, string> campaignEnvToJavaEnumKey;

		private static Dictionary<MESSAGE_LANGUAGE, string> messageLanguageToJavaKey;

		static CSharp2JavaStringEnumMapper()
		{
			InitializeMapping();
		}

		public static string GetMessageLanguageKey(MESSAGE_LANGUAGE lang)
		{
			return messageLanguageToJavaKey[lang];
		}

		public static string GetCampaignEnvKey(CAMPAIGN_ENV environment)
		{
			return campaignEnvToJavaEnumKey[environment];
		}

		public static string GetPrivacyManagerTabKey(PRIVACY_MANAGER_TAB tab)
		{
			return privacyManagerTabToJavaEnumKey[tab];
		}

		private static void InitializeMapping()
		{
			InitializePrivacyManagerTabMapping();
			InitializeCampaignEnvMapping();
			InitializeMessageLanguageMapping();
		}

		private static void InitializeMessageLanguageMapping()
		{
			messageLanguageToJavaKey = new Dictionary<MESSAGE_LANGUAGE, string>();
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.BULGARIAN, "BG");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.CHINESE, "ZH");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.CROATIAN, "HR");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.CZECH, "CS");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.DANISH, "DA");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.DUTCH, "NL");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.ENGLISH, "EN");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.ESTONIAN, "ET");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.FINNISH, "FI");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.FRENCH, "FR");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.GAELIC, "GD");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.GERMAN, "DE");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.GREEK, "EL");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.HUNGARIAN, "HU");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.ICELANDIC, "IS");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.ITALIAN, "IT");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.JAPANESE, "JA");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.LATVIAN, "LV");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.LITHUANIAN, "LT");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.NORWEGIAN, "NO");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.POLISH, "PL");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.PORTUGEESE, "PT");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.ROMANIAN, "RO");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.RUSSIAN, "RU");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SERBIAN_CYRILLIC, "SR-CYRL");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SERBIAN_LATIN, "SR-LATN");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SLOVAKIAN, "SK");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SLOVENIAN, "SL");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SPANISH, "ES");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.SWEDISH, "SV");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.TURKISH, "TR");
			messageLanguageToJavaKey.Add(MESSAGE_LANGUAGE.CATALAN, "CA");
		}

		private static void InitializeCampaignEnvMapping()
		{
			campaignEnvToJavaEnumKey = new Dictionary<CAMPAIGN_ENV, string>();
			campaignEnvToJavaEnumKey.Add(CAMPAIGN_ENV.PUBLIC, "prod");
			campaignEnvToJavaEnumKey.Add(CAMPAIGN_ENV.STAGE, "stage");
		}

		private static void InitializePrivacyManagerTabMapping()
		{
			privacyManagerTabToJavaEnumKey = new Dictionary<PRIVACY_MANAGER_TAB, string>();
			privacyManagerTabToJavaEnumKey.Add(PRIVACY_MANAGER_TAB.DEFAULT, "");
			privacyManagerTabToJavaEnumKey.Add(PRIVACY_MANAGER_TAB.PURPOSES, "purposes");
			privacyManagerTabToJavaEnumKey.Add(PRIVACY_MANAGER_TAB.VENDORS, "vendors");
			privacyManagerTabToJavaEnumKey.Add(PRIVACY_MANAGER_TAB.FEATURES, "features");
		}
	}
}
